package com.jay.io.intf;

import java.io.File;
import java.io.FileFilter;

public class FileFilterIntf implements FileFilter {
	private String keyword;

	public FileFilterIntf(String keyword) {
		this.keyword = keyword;
	}

	@Override
	public boolean accept(File pathname) {
		return pathname.getName().toLowerCase().indexOf(keyword) >= 0;
	}

	public static void main(String[] args) {
		File path = new File("d:/");
		File[] list = path.listFiles(new FileFilterIntf("pro"));
		for (int i = 0; i < list.length; i++) {
			System.out.println(list[i].getName());
		}
	}

}
